import axios from 'axios';

import qs from 'querystring';
export interface menu {
  title: any;
  menuName?: string;
  createTimeFrom?: string;
  createTimeTo?: string;
}

export const getMenu = (name = '', data?: any) => {
  return axios.get(`/menu/${name}`, data);
};
export const deleteMenu = (id: string) => {
  return axios.delete(`/menu/${id}`);
};

export const addMenu = (menu: any) => {
  return axios.post(`/menu/`, menu);
};

export const updateMenu = (menu: any) => {
  return axios.put(`/menu`, qs.stringify(menu));
};
